微信支付订单号查询
商户可以通过查询订单接口主动查询订单状态,完成下一步的业务逻辑。查询订单状态可通过微信支付订单号或商户订单号两种方式查询
| 请求参数 | 类型 | 描述 |
|---|---|---|
| transaction_id | string | 微信支付订单号 |
| query | object | 声明请求的查询参数 |
| sp_mchid | string | 服务商户号 |
| sub_mchid | string | 子商户号 |
php
$instance->v3->pay->partner->transactions->id->_transaction_id_->getAsync([
'transaction_id' => '1217752501201407033233368018',
'query' => [
'sp_mchid' => '1230000109',
'sub_mchid' => '1900000109',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/pay/partner/transactions/id/{transaction_id}')->getAsync([
'transaction_id' => '1217752501201407033233368018',
'query' => [
'sp_mchid' => '1230000109',
'sub_mchid' => '1900000109',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/pay/partner/transactions/id/{transaction_id}']->getAsync([
'transaction_id' => '1217752501201407033233368018',
'query' => [
'sp_mchid' => '1230000109',
'sub_mchid' => '1900000109',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->pay->partner->transactions->id->_transaction_id_->get([
'transaction_id' => '1217752501201407033233368018',
'query' => [
'sp_mchid' => '1230000109',
'sub_mchid' => '1900000109',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/pay/partner/transactions/id/{transaction_id}')->get([
'transaction_id' => '1217752501201407033233368018',
'query' => [
'sp_mchid' => '1230000109',
'sub_mchid' => '1900000109',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/pay/partner/transactions/id/{transaction_id}']->get([
'transaction_id' => '1217752501201407033233368018',
'query' => [
'sp_mchid' => '1230000109',
'sub_mchid' => '1900000109',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| sp_appid | string | 服务商公众号ID |
| sp_mchid | string | 服务商户号 |
| sub_appid | string | 子商户公众号ID |
| sub_mchid | string | 子商户号 |
| settle_info | object | 结算信息 |
| profit_sharing | boolean | 是否指定分账 |
| subsidy_amount | integer | 补差金额 |
| transaction_id | string | 微信支付订单号 |
| trade_type | string | 交易类型 |
| trade_state | string | 交易状态 |
| trade_state_desc | string | 交易状态描述 |
| bank_type | string | 付款银行 |
| success_time | string | 支付完成时间 |
| description | string | 商品描述 |
| attach | string | 附加数据 |
| out_trade_no | string | 商户订单号 |
| amount | object | 订单金额 |
| total | integer | 总金额 |
| currency | string | 货币类型 |
| time_expire | string | 交易结束时间 |
| notify_url | string | 通知地址 |
| goods_tag | string | 订单优惠标记 |
| limit_pay | string[] | 指定支付方式no_balance | no_credit | no_debit | balance_only 枚举值之一 |
| support_fapiao | boolean | 电子发票入口开放标识 |
| detail | object | 优惠功能 |
| cost_price | integer | 订单原价 |
| invoice_id | string | 商品小票ID |
| goods_detail | object[] | 单品列表 |
| merchant_goods_id | string | 商户侧商品编码 |
| wechatpay_goods_id | string | 微信侧商品编码 |
| goods_name | string | 商品名称 |
| quantity | integer | 商品数量 |
| unit_price | integer | 商品单价 |
| scene_info | object | 场景信息 |
| payer_client_ip | string | 用户终端IP |
| device_id | string | 商户端设备号 |
| store_info | object | 商户门店信息 |
| id | string | 门店编号 |
| name | string | 门店名称 |
| area_code | string | 地区编码 |
| address | string | 详细地址 |
| payer | object | 支付者 |
| sp_openid | string | 用户服务标识 |
| sub_openid | string | 用户子标识 |